package cn.lanqiao.system.service.impl;

import cn.lanqiao.common.entity.Cart;
import cn.lanqiao.common.vo.CartVo;
import cn.lanqiao.system.mapper.CartMapper;
import cn.lanqiao.system.service.CartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
public class CartServiceImpl implements CartService {

    @Autowired
    private CartMapper cartMapper;
    @Override
    public int save(@RequestBody  Cart cart) {
        return cartMapper.insertSelective(cart);
    }

    @Override
    public int delete(Integer id) {
        return cartMapper.deleteByPrimaryKey(id);
    }

    @Override
    public List<CartVo> getAll(Integer id) {
        return cartMapper.getAll(id);
    }
}
